using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using LeadTracker.EFCodeFirst.Entities;
using LeadTracker.EFCodeFirst.Mapping;

namespace LeadTracker.EFCodeFirst
{
	public class LeadTrackerContext : DbContext
	{
		static LeadTrackerContext()
		{ 
			Database.SetInitializer<LeadTrackerContext>(null);
		}

		public DbSet<C__RefactorLog> C__RefactorLog { get; set; }
		public DbSet<Editor> Editors { get; set; }
		public DbSet<Lead> Leads { get; set; }
		public DbSet<LeadComment> LeadComments { get; set; }
		public DbSet<LeadType> LeadTypes { get; set; }

		protected override void OnModelCreating(DbModelBuilder modelBuilder)
		{
			modelBuilder.Conventions.Remove<IncludeMetadataConvention>();
			modelBuilder.Configurations.Add(new C__RefactorLogMap());
			modelBuilder.Configurations.Add(new EditorMap());
			modelBuilder.Configurations.Add(new LeadMap());
			modelBuilder.Configurations.Add(new LeadCommentMap());
			modelBuilder.Configurations.Add(new LeadTypeMap());
		}
	}
}

